<?php

namespace app\admin\controller;

use think\Controller;
use think\facade\Env;
use think\Db;
use think\Exception;
use app\common\model\ProductCommentModel;
use app\common\model\UserModel;

class TestController extends Controller
{
    public function index($id = 6)
    {
        // all()  不会出现异常
        // findOrEmpty() 不会出现异常 []

        $data['user'] = ProductCommentModel::all();
        $data['user'] = UserModel::with('roles')->findOrEmpty($id);
        return zbcjson($data);
    }
}
